package com.ruoyi.vegetable.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.vegetable.mapper.ExVegetableMapper;
import com.ruoyi.vegetable.domain.ExVegetable;
import com.ruoyi.vegetable.service.IExVegetableService;

/**
 * 蔬菜管理-子菜单Service业务层处理
 * 
 * @author 2702梁家琦
 * @date 2024-04-18
 */
@Service
public class ExVegetableServiceImpl implements IExVegetableService 
{
    @Autowired
    private ExVegetableMapper exVegetableMapper;

    /**
     * 查询蔬菜管理-子菜单
     * 
     * @param id 蔬菜管理-子菜单主键
     * @return 蔬菜管理-子菜单
     */
    @Override
    public ExVegetable selectExVegetableById(Long id)
    {
        return exVegetableMapper.selectExVegetableById(id);
    }

    /**
     * 查询蔬菜管理-子菜单列表
     * 
     * @param exVegetable 蔬菜管理-子菜单
     * @return 蔬菜管理-子菜单
     */
    @Override
    public List<ExVegetable> selectExVegetableList(ExVegetable exVegetable)
    {
        return exVegetableMapper.selectExVegetableList(exVegetable);
    }

    /**
     * 新增蔬菜管理-子菜单
     * 
     * @param exVegetable 蔬菜管理-子菜单
     * @return 结果
     */
    @Override
    public int insertExVegetable(ExVegetable exVegetable)
    {
        exVegetable.setCreateTime(DateUtils.getNowDate());
        return exVegetableMapper.insertExVegetable(exVegetable);
    }

    /**
     * 修改蔬菜管理-子菜单
     * 
     * @param exVegetable 蔬菜管理-子菜单
     * @return 结果
     */
    @Override
    public int updateExVegetable(ExVegetable exVegetable)
    {
        exVegetable.setUpdateTime(DateUtils.getNowDate());
        return exVegetableMapper.updateExVegetable(exVegetable);
    }

    /**
     * 批量删除蔬菜管理-子菜单
     * 
     * @param ids 需要删除的蔬菜管理-子菜单主键
     * @return 结果
     */
    @Override
    public int deleteExVegetableByIds(Long[] ids)
    {
        return exVegetableMapper.deleteExVegetableByIds(ids);
    }

    /**
     * 删除蔬菜管理-子菜单信息
     * 
     * @param id 蔬菜管理-子菜单主键
     * @return 结果
     */
    @Override
    public int deleteExVegetableById(Long id)
    {
        return exVegetableMapper.deleteExVegetableById(id);
    }
}
